package com.usian.ai.controller;

import com.usian.ai.common.Result;
import com.usian.ai.pojo.vo.LoginReqVo;
import com.usian.ai.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 12 03 11 34
 **/

@RestController
@RequestMapping("/admin")
@CrossOrigin
public class AdminController {


    final
    AdminService adminService;

    public AdminController(AdminService adminService) {
        this.adminService = adminService;
    }


    @PostMapping("/login")
    public Result login(@Validated @RequestBody LoginReqVo loginReqVo){
        return adminService.login(loginReqVo);
    }


}
